package com.serverapk.para;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.annotation.SuppressLint;
import android.os.Environment;

import com.serverapk.socket.SocketUtil;

@SuppressLint("UseSparseArrays")
public class Common {

    public static String imei = "";
    public static final String filepath = "/sdcard/tony/";
    public static final String filepath_bak = "/sdcard/tonybak/";

    //post请求参数
//	public static final String initUrl = "https://api.nex-i.cn/dmg/device/init";  //启动参数
//	public static final String notifyUrl = "https://api.nex-i.cn/dmg/device/notify";  //结果通知
//	public static final String imageUrl = "https://api.nex-i.cn/dmg/device/image"; //图片上传
//	public static final String statusUrl = "https://api.nex-i.cn/dmg/device/status"; //状态上传
//	public static final String heartUrl = "https://api.nex-i.cn/dmg/device/heartbeat"; //上报设备心跳
//	public static final String errorUrl = "https://api.nex-i.cn/dmg/device/error"; //错误上报
//	public static final String cardUrl = "https://api.nex-i.cn/dmg/device/card"; //刷卡开门

    public static final String initUrl = "http://api.nex-i.cn/dmg/device/init";  //启动参数
    public static final String notifyUrl = "http://api.nex-i.cn/dmg/device/notify";  //结果通知
    public static final String imageUrl = "http://api.nex-i.cn/dmg/device/image"; //图片上传
    public static final String statusUrl = "http://api.nex-i.cn/dmg/device/status"; //状态上传
    public static final String heartUrl = "http://api.nex-i.cn/dmg/device/heartbeat"; //上报设备心跳
    public static final String errorUrl = "http://api.nex-i.cn/dmg/device/error"; //错误上报
    public static final String cardUrl = "http://api.nex-i.cn/dmg/device/card"; //刷卡开门

    public static final String getListUrl = "http://dmg.nex-i.cn/api/box_goods"; //获取清单列表
    public static final String getVideoUrl = "http://dmg.nex-i.cn/api/ad"; //获取视频列表

//    public static final String getListUrl = "http://ioth5.xiangxintec.com/api/box_goods"; //获取清单列表
//    public static final String getVideoUrl = "http://ioth5.xiangxintec.com/api/ad"; //获取视频列表

    public static final String getOssUrl = "http://api.nex-i.cn/dmg/device/oss-url"; //获取上传OSS地址

    public static final String appId = "GwDVHBHupfLpzXAU";
    public static final String appSecret = "Cvdc3Z17Lfs7jLPkbD3Bs73eOdCy565Q";

    //启动获取参数
    public static String instance_id = "";
    public static String topic = "";
    public static String group_id = "";
    public static String mqtt_host = "";
    public static String mqtt_port = "";
    public static String Signature = "Signature";
    public static String mqtt_access_key = "D5EFE10793E6862E40FED051DAC3EED5";
    public static String mqtt_secret_key = "4EDF1C967A847699A407F42B75446064";
    public static String md5 = "";
    public static List<String> cameraIp = new ArrayList<String>();
    public static int cameraPort = 60322;
    public static int max_width = 1024;
    public static int max_height = 1024;
    public static int heartTime = 5;
    public static int serverTime = 0;
    //设备类型 1:静态视觉识别柜，2:动态视觉识别柜
    public static int type = 0;

    public static String endPoint = "";
    public static String url = "";
    public static String accessKey = "";
    public static String secretKey = "";
    public static String bucketName = "";

    public static List<String> IPlist = Arrays.asList("192.168.9.81", "192.168.9.82");    //"192.168.9.81","192.168.9.82","192.168.9.83","192.168.9.84" Arrays.asList("192.168.9.81");
    public static Map<Integer, SocketUtil> socketMap = new HashMap<Integer, SocketUtil>();

    public static String camera_url = "https://cloud.seetatech.com/api/seetaas/nex_all_1";   //算法服务器
    public static String camera_api_key = "D5EFE10793E6862E40FED051DAC3EED5";
    public static String camera_secret_key = "4EDF1C967A847699A407F42B75446064";
    public static String dev_id = "";
    public static int version = 1;
    public static int app_version = 1;

    //mqtt指令
    public static final String open_door = "open-door";
    public static final String check_goods = "check-goods";
    public static final String restart = "restart";
    public static final String reboot = "reboot";
    public static final String upgrade = "upgrade";
    public static final String payment = "payment";
    public static final String refresh = "refresh-storage";
    public static String seq = "";


    //lock
    public static final String test_gpio1 = "99"; // 开关锁
    public static final String check_gpio1 = "98"; // 锁反馈
    public static final String check_gpio2 = "22"; // 门反馈

//    public static final String test_gpio1 = "10"; // 开关锁
//    public static final String check_gpio1 = "65"; // 锁反馈
//    public static final String check_gpio2 = "64"; // 门反馈

    public static final int open_lock = 0;
    public static final int close_lock = 1;

    public static final int open_lock_state = 1;
    public static final int close_lock_state = 0;

    public static int last_check_gpio1 = -1;
    public static int last_check_gpio2 = -1;


    //错误码及描述
    public static final int error_code1 = 10001;
    public static final String error_info1 = "网络连接失败";
    public static final int error_code2 = 10002;
    public static final String error_info2 = "获取图片失败";
    public static final int error_code3 = 10003;
    public static final String error_info3 = "获取图片异常";
    public static final int error_code4 = 10004;
    public static final String error_info4 = "上传算法服务器异常";
    public static final int error_code5 = 10005;
    public static final String error_info5 = "ping摄像头失败";
    public static final int error_code6 = 10006;
    public static final String error_info6 = "apk下载失败";
    public static final int error_code7 = 10007;
    public static final String error_info7 = "apk安装失败";

    public static final int error_code8 = 10008;
    public static final String error_info8 = "apk安装失败";
    public static final int error_code9 = 10009;
    public static final String error_info9= "上传视频失败";

    public static final int error_code10 = 10010;
    public static final String error_info10= "视频SDK初始化失败";

    //广告
    public static final String ad_path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Movies" + "/ad.mp4";  //视频路径
    public static final int ad_img_time = 5000;//图片滚动间隔时间


    //动态柜视频保存的文件夹名称
    public static final String video_path = "/mnt/sdcard/daMaiGui/video";
    public static final String log_path = "/mnt/sdcard/daMaiGui/log";
    public static final String base_path = "/mnt/sdcard/daMaiGui";
    public static final String crash_path = "/sdcard/daMaiGui/crash";
}
